<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/

Route::get('/', function()
{
	return View::make('hello');
});

// Upload using submit, not work in IE7-9.
Route::get('/uploadCsv', 'UploadCsvController@uploadCsv');
Route::post('/doUploadCsv', 'UploadCsvController@doUpload');

// Upload using Uploadify.
Route::get('/uploadify/show', 'UploadifyController@show');
Route::post('/uploadify/upload', 'UploadifyController@upload');
//Route::get('/uploadify', 'UploadifyController@show');

// Test IOC.
Route::get('/ioc', 'UploadifyController@ioc');




// Route::match(array('GET', 'POST'), '/any', function()
// {
//     return 'Hello World';
// });

// Route::get('user/{id}/{name?}/{age?}', 
// 	array('before' => 'lessThan'),
// 	function($id, $name = "John", $age = 10) {
//     	return 'Id: '.$id . "; name: " . $name . "; age: " . $age;
// 	}
// )
// ->where('age', '[0-9]+');

// Route::filter('lessThan', function()
// {
//     if (Route::input('age') < 5) {
//     	return "Wrong input";
//     }
//     else {
//     	return "OK";
//     }
// });

// App::missing(function($exception)
// {
// 	return "404";
//     //return Response::view('errors.missing', array(), 404);
// });